//
//  DetalilPriceCell.m
//  LvXi_newVersion
//
//  Created by 王敏 on 16/8/15.
//  Copyright © 2016年 SJT. All rights reserved.
//

#import "DetalilPriceCell.h"

@interface DetalilPriceCell()

/**容器视图*/


@property(nonatomic,weak)IBOutlet UIView * containerView;


@property (weak, nonatomic) IBOutlet NSLayoutConstraint *marginLeftConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *discountMarginLeft;

@property (weak, nonatomic) IBOutlet UILabel *mallPrice;

@property (weak, nonatomic) IBOutlet UILabel *payBack;

@property (weak, nonatomic) IBOutlet UILabel *discount;

@end

@implementation DetalilPriceCell


-(void)awakeFromNib{
    [super awakeFromNib];
    self.backgroundColor = HexColor(@"#EEEEEE");
    self.contentView.backgroundColor = HexColor(@"#EEEEEE");
    self.cellHeight = Ratio_Home_Height(83.5);
    self.discountMarginLeft.constant = 0;
}
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        self.backgroundColor = HexColor(@"#EEEEEE");
        self.contentView.backgroundColor = HexColor(@"#EEEEEE");
        self.cellHeight = 60;
        UIView * containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth-100, self.cellHeight)];
        [self.contentView addSubview:containerView];
        self.containerView = containerView;
        containerView.backgroundColor = RandColor;

    }
    return self;
}

-(void)setMarginLeft:(CGFloat)marginLeft{
    _marginLeft = marginLeft;
    self.marginLeftConstraint.constant = _marginLeft;
}


-(void)setProduct:(Product *)product{
    _product = product;
    self.mallPrice.text = product.price;
    self.discount.text = product.pointdeduction;
    self.payBack.text = product.cost;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    
}
@end
